FROM nginx

WORKDIR /usr/share/nginx/html

RUN rm -rf ./*  && apt update && apt install -y curl

# 下载 letsencrypt-renew 并赋予可执行权限
RUN curl -o /usr/bin/letsencrypt-renew https://letsencrypt.top/download/letsencrypt-renew && chmod +x /usr/bin/letsencrypt-renew

# 复制构建产物
COPY workflow-ui/ .

# 复制 Nginx 配置
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf

# 创建 SSL 证书目录并复制证书
RUN mkdir -p /etc/nginx/ssl
COPY ./nginx/lsjscl.vip_certificate.pem /etc/nginx/ssl/
COPY ./nginx/lsjscl.vip_private.key /etc/nginx/ssl/

# 设置权限
RUN chmod -R 755 /usr/share/nginx/html && chmod 600 /etc/nginx/ssl/*.key

EXPOSE 443
